const Mock = require('mockjs');

/**
 * 法律服务团队
 */
function getLegalServiceTeamList () {
  const { Random } = Mock;
  let list = [];
  let randomNumber = Math.ceil(Math.random() * 48);
  for (let i = 0; i < randomNumber; i++) {
    let item = Mock.mock({
      'GuidLegalServiceTeam': Random.guid(),
      'Name': Random.cname(),
      'Degree|1': [
        '学士',
        '硕士',
        '博士'
      ],
      'Description': `${Random.province()}${Random.cword(3, 5)}律师事务所`,
      'Picture|1': [
        'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1548159642364&di=471929fda9fb237ecfbec5f921258512&imgtype=0&src=http%3A%2F%2Fpic42.photophoto.cn%2F20170305%2F1155117160017041_b.jpg'
      ] 
    });
    list.push(item);
  }
  return list;
}

function getLegalServiceTeamInfo (guidLegalServiceTeam) {
  const { Random } = Mock;
  return Mock.mock({
    GuidLegalServiceTeam: guidLegalServiceTeam,
    'Name': Random.cname(),
    'Degree|1': [
      '学士',
      '硕士',
      '博士'
    ],
    'Description': `${Random.province()}${Random.cword(60, 200)}`,
    'Picture|1': [
      `${Random.url('https')}/${Random.last()}.jpg`,
      `${Random.url('https')}/${Random.last()}.png`,
      `${Random.url('https')}/${Random.last()}.jpeg`
    ],
    'Video': Random.url('https')
  });
}


module.exports = {
  getLegalServiceTeamList,
  getLegalServiceTeamInfo
}